﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PRE
{
    using BLL;
    using DAL.Entities;
    public partial class frmChucvu : Form
    {
        ChucvuBLL _chucvuBLL = new BLL.ChucvuBLL();
        public frmChucvu()
        {
            
            InitializeComponent();
        }

        private void frmChucvu_Load(object sender, EventArgs e)
        {
            var bll = new BLL.ChucvuBLL();
            dataGridView_Chucvu.DataSource = bll.Select();
        }

        private void dataGridView_Chucvu_RowEnter(object sender, DataGridViewCellEventArgs e)
        {
            txtTaikhoan.Text = dataGridView_Chucvu[0, e.RowIndex].Value + "";
            var tmp = (Chucvu)_chucvuBLL.Select(txtTaikhoan.Text);
            if (tmp != null)
            {
                txtMatkhau.Text = tmp.TEN_CV;
                


            } 
        }

        private void dataGridView_Chucvu_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {

        }

        private void label2_Click(object sender, EventArgs e)
        {


        }
    }
}
